﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace Entity
{
    public class TblProductPurchaseOrder_MultipleShippingInfo_Extended : TblProductPurchaseOrder_MultipleShippingInfo
    {
        public static bool DeleteTblProductPurchaseOrder_MultipleShippingInfo (Int32 OrderId)
        {
            if (OrderId <= GetProductPurchaseOrder_MultipleShippingInfoIdMinValue)
                throw (new ArgumentOutOfRangeException("productPurchaseOrder_MultipleShippingInfoId"));

            // Execute SQL Command
            SqlCommand sqlCmd = new SqlCommand();
            AddParameterToSqlCmd(sqlCmd, "@ReturnValue", SqlDbType.Int, 0, ParameterDirection.ReturnValue, null);
            AddParameterToSqlCmd(sqlCmd, "@OrderId", SqlDbType.Int, 0, ParameterDirection.Input, OrderId);
            SetCommandType(sqlCmd, CommandType.StoredProcedure, "DeleteTblProductPurchaseOrder_MultipleShippingInfo_By_OrderId");
            ExecuteScalarCmd(sqlCmd);
            int returnValue = (int)sqlCmd.Parameters["@ReturnValue"].Value;
            return (returnValue == 0 ? false : true);

        }
    }
}
